const fs = require('fs')

/**
 * 创建文件目录
 */
const makeDirectory = (filePath) => {
    console.log("filePath:",filePath)
    const arr = filePath.split('/');
    let dir = arr[0];
    for (let i = 1; i < arr.length; i++) {
        if (!fs.existsSync(dir)) {
            fs.mkdirSync(dir);
        }
        dir = dir + '/' + arr[i];
    }
    return true
    // fs.writeFileSync(filePath, '')
}

module.exports = {makeDirectory}
